


#include "stdafx.h"
#include "NRecycleObjectPoolMgr.h"



NRecycleObjectPoolMgr::NRecycleObjectPoolMgr()
{
	m_bOK = false;
	m_bOK = true;
}

NRecycleObjectPoolMgr::~NRecycleObjectPoolMgr()
{
}

NRecycleObject* NRecycleObjectPoolMgr::Alloc( const string in_Name )
{
	POOLMAP::iterator iter = m_PoolMap.find( in_Name );
	if( iter != m_PoolMap.end() )
	{
		NRecycleObjectPoolInter* cpRecycleObjectPoolInter = iter->second;
		return cpRecycleObjectPoolInter->Alloc();
	}
	return NULL;
}

void NRecycleObjectPoolMgr::Free( const string in_Name, NRecycleObject* in_cpRecycleObject )
{
	POOLMAP::iterator iter = m_PoolMap.find( in_Name );
	if( iter != m_PoolMap.end() )
	{
		NRecycleObjectPoolInter* cpRecycleObjectPoolInter = iter->second;
		cpRecycleObjectPoolInter->Free( in_cpRecycleObject );
	}
}

//
//bool NRecycleObjectPoolMgr::Register( const string in_Name, NRecycleObjectPoolInter* in_RecycleObjectPoolInter )
//{
//	pair< POOLMAP::iterator, bool > ret = m_PoolMap.insert( make_pair( in_Name, in_RecycleObjectPoolInter ) );
//	return ret.second;
//}